# 导包
import unittest
from script.test01_login import TestLoginAPI
import app
from lib.HTMLTestRunner_PY3 import HTMLTestRunner

# 组装测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLoginAPI))

# 定义报告路径及名称
# 要想实现持续集成 报告名称必须使用固定名称，否则在jenkins中经常出现报告找不到，页面报错404
report = app.BASE_DIR + "/report/report.html"

# 打开文件流
with open(report, "wb") as f:
    # 创建runner
    runner = HTMLTestRunner(f)
    # 执行suite
    runner.run(suite)
